<?php function showForm() {
 include_once ("scripts/database.php");	
 include_once ("scripts/single_product.php");
 $id = isset($_GET["id"]) ? $_GET["id"] : -1;
 if ($id > -1) {
 	$connection = mysqli_connect(DB_HOST, DB_USERNAME, DB_PASS, DB_NAME);
 	$product = getSpecifiedProductFromDatabase($connection, $id);
 }
 else {
 	$product = array("", "", "", "", "");
 }	
?>
<form id="productForm" action="scripts/product_edited.php" method="post">
	<table>
		<tr><td><label for="productName">Nazwa produktu:</label></td><td><input id="productName" type="text" value="<?php echo $product[1]?>" name="prodName"/></td></tr>
		<tr><td><label for="productCategory">Kategoria produktu:</label></td><td><input id="productCategory" type="text" value="<?php echo $product[3]?>" name="prodCategory"/></td></tr>
		<tr><td><label for="productSubcategory">Podkategoria produktu:</label></td><td><input id="productSubcategory" type="text" value="<?php echo $product[2]?>" name="prodSubCategory"/></td></tr>
		<tr><td><label for="productPrice">Cena produktu:</label></td><td><input id="productPrice" type="text" value="<?php echo $product[4]?>" name="prodPrice"/></td></tr>
	</table>
	<input type="hidden" value="<?php echo $product[0]?>" name="prodId"/>
	<input type="submit" value="Dodaj"/>
</form>
<?php } ?>
